package model;

import java.io.File;

import common.BaseModel;
import common.Constant;

/**
 * 服务器共享出来的文件.
 * 
 * @author guanweichen
 * @version 2010-12-18
 */
public class ShareFileModel extends BaseModel {

	private static final long serialVersionUID = -6332554604371423344L;
	/** 服务器上文件物理路径 */
	private String serverFilePath;
	/** 客户端显示名称,服务器唯一名称 */
	private String fileName;
	/** Log file */
	private File file;
	/** 文件编码*/
	private String encoding;
	
	public ShareFileModel() {
	}
	public ShareFileModel(String serverFilePath, String fileName) {
		this.serverFilePath = serverFilePath;
		this.fileName = fileName;
		this.encoding = Constant.DEFAULT_ENCODING;
	}
	public ShareFileModel(String serverFilePath, String fileName, String encoding) {
		this.serverFilePath = serverFilePath;
		this.fileName = fileName;
		this.encoding = encoding;
	}
	public String getServerFilePath() {
		return serverFilePath;
	}
	public void setServerFilePath(String serverFilePath) {
		this.serverFilePath = serverFilePath;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public File getFile() {
		return file;
	}
	public void setFile(File file) {
		this.file = file;
	}
	public String getEncoding() {
		return encoding;
	}
	public void setEncoding(String encoding) {
		this.encoding = encoding;
	}
	public boolean checkIsAdd() {
		return fileName != null && fileName != "" && serverFilePath != null && serverFilePath != "";
	}
}
